<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link href="css/ydui.css" rel="stylesheet" type="text/css">
		<script src="js/jquery-1.11.1.js"></script>
		<script src="http://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
		<script type="text/javascript" src="js/jquery.qrcode.min.js"></script>
		<script type="text/javascript" src="js/WeixinApi.js"></script>
		<title>漳泽农商银行开门红</title>
		<style>
			
			.cont{width:80%;background:white;box-sizing: border-box;padding:0 10px;margin:0 auto;margin-top:100%;border-radius: 10px;padding-bottom: 10px;padding-top:10px}
			.cont h4{
				color: #333;
				font-size: 14px;
				font-weight:900;
				
				line-height: 30px;
				
				text-align: center;}
				.cont p{
					color: #666;
				font-size: 12px;
				
				margin-top: 10px;
				text-align: center;
				box-sizing: border-box;
				}
			.yxhm{font-size:14px;color:#B30E06}
			.input{width:80%;border:1px #ECECEC solid;background:white;height:35px;line-height:35px;padding-left:10px;}
			.btn1{
				width: 80%;
				height: 30px;
				line-height: 30px;
				margin-left:3%;
				
				border: 0;
				background: #FFB734;
				border-radius: 15px;
				color: white;
				font-size: 14px;
				font-weight: 700
			}
		</style>
	</head>

	<body >
			<section class="g-flexview">
			<!--<header class="m-navbar">
				<a href="wx_cjlb" class="navbar-item"><i class="back-ico"></i></a>
				<div class="navbar-center"><span class="navbar-title">分享推广</span></div>
			</header>-->
			<div class="g-scrollview" style="background:url(images/fx4.png) no-repeat;background-size:100% 100%;position: relative;width:100%;height:100%;box-sizing: border-box;padding-bottom: 40px;padding-top:10px;overflow-y: auto;">
				<div class="cont">
					<h4>推广人工号：<b class="yxhm"></b></h4>
					<p ><input class="input" placeholder="请输入您的推广人工号" type="number" id="num"></p>
					<p style="margin-top:40px;margin-bottom: 15px;"><button class="btn1">保存信息</button></p>
					<div id="qrcode" style=";margin:10px auto;text-align: center; display: none;"></div>
				</div>			
			</div>
		</section>
		<script src="js/ydui.flexible.js"></script>
		<script src="js/ydui.js"></script>
		<script src="js/base.js"></script>
		<script>
			$(function() {
				/*YDUI.dialog.loading.open('正在加载数据')*/
				var code=''
				$.post("selectActivityDateType",{activityType: '14'}, function(data) {
						/*YDUI.dialog.alert(JSON.stringify(data))*/
					if(data.code == 0) {
						code = data.data.活动代码

						abb(code)
					} else {
						YDUI.dialog.alert("活动已结束，敬请期待下次活动开启", function() {
							
						})
					}
				})
				$(".btn1").click(function(){
					var num=$("#num").val()
					if(num==""){
						YDUI.dialog.alert("请输入您的推广人工号")
						return
					}
					$.post('insertUserByopenid',{number4:num,activityType:code},function(data){
						if(data.code==0){
							YDUI.dialog.alert(data.message, function() {
							 window.location.replace("http://yykh.czzrcb.com/zzhddj/getygCode")
							})
						}else{
							YDUI.dialog.alert(data.message)
						}
					})
				})
				function abb(code) {
					$.post("selectListByOpenId", {
						activityType: '14'
					}, function(data) {
						if(data.code == 0) {
							var rel = data.data[0]
							var fxdz = ''
							if(rel.营销经理 == null || rel.营销经理 == undefined || rel.营销经理 == '') {
								fxdz = 'http://yykh.czzrcb.com/zzhddj/wx_hqbm2'
								$(".yxhm").text("未填写")
							} else {
								$("p").css("display","none")
								fxdz = "http://yykh.czzrcb.com/zzhddj/wx_hqbm2?yxbh=" + rel.营销经理
								$(".yxhm").text(rel.营销经理)
								$("#qrcode").css("display","block")
								$('#qrcode').qrcode({
								 text: fxdz,
								   width: 200,
								   height: 200,
							})
							}
							
						}
					})
				}

			})
		</script>
	</body>

</html>